package org.javaboy.redisson_demo.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class RedissonConfig {

    @Bean("redis6379")
    @Primary
    public RedissonClient redis6379() {
        Config config = new Config();
        config.useSingleServer().setAddress("redis://centos.javaboy.org:6379").setPassword("123");
        return Redisson.create(config);
    }

//    @Bean("redis6380")
    public RedissonClient redis6380() {
        Config config = new Config();
        config.useSingleServer().setAddress("redis://centos.javaboy.org:6380").setPassword("123");
        return Redisson.create(config);
    }
}
